\name{scp-package}
\alias{scp-package}
\alias{scp}
\docType{package}
\title{
Tools for quantification, comparision and modeling spatial population/community patterns from individual-mapped data
}
\description{
Based on general individual-mapped data from the CTFS (http://www.ctfs.si.edu/; http://www.cfbiodiv.org/), the package can easily produce various spatial inexplicit and explicit population and community structures, such as intra-specific spatial abundance distribution, box-couting range area relationship, intra-specific commonality, intra-specific dispersal distribution, nearest neighborhood distribution for population, and species abudance distribution (SAD), species area relationship (SAR), endemics area relationship (EAR), community level commonality, collector's curve, pairwise association matrix et al. for communities.

The package also include various null models of population and communities for testing ecological hypotheses.
}
\details{
\tabular{ll}{
Package: \tab scp\cr
Type: \tab Package\cr
Version: \tab 0.2\cr
Date: \tab 2015-03-05\cr
License: \tab GPL (>= 2)\cr
}
}

\section{Overview}{

Current development of the package focus on quantification, visualization and other basic operations of various population and community structures. The whole package is built from two fundamental objects: population and community, and other related objects.

\bold{Main objects}
\itemize{
  \item \code{\link{population}}
  \item \code{\link{community}}
  \item \code{\link{env}}
  \item traits
  \item phylogeny
}


\bold{Other basic objects}
  \tabular{ll}{
    \code{\link{traits}} \tab define a species level traits object \cr
    \code{\link{phylogeny}} \tab define a phylogenetic tree \cr
    \code{\link{read_newick}} \tab read phylogenetic newick tree with singleton \cr
    \code{\link{litterfall}} \tab define a litterfall object with multiple observations \cr
    \code{\link{seedlings}} \tab define a seedling object with multiple observations \cr
    \code{\link{seeds}} \tab define a seeds object with multiple observations \cr
  }


}
 
\section{I. Basic operations for Main objects}{
 
  
  \bold{population/community}
  \tabular{ll}{
    \code{\link[=subset.population]{subset}} \tab extract subset of a population/community, e.g. small individuals \cr
    \code{\link[=merge.population]{merge}} \tab combine populations into a community or merged two communities in one\cr
    \code{\link[=split.community]{split}} \tab split a community into a list of populations \cr
    \code{\link{remove_individuals}} \tab remove individuals from the population/community \cr
    \code{\link{get_population}} \tab get a specific population from the whole community \cr
    \code{\link{get_populations}} \tab get a community contains the given species \cr
    \code{\link{remove_species}} \tab remove given species from the community \cr
    \code{\link{remove_rare_species}} \tab remove rare species from the community \cr
    \code{\link[=plot.population]{plot}} \tab display the map of population distribution \cr
    \code{\link{plot_density}} \tab display the density of individuals across the plot \cr
    \code{\link{is_overlapped}} \tab test whether individuals are spatially overlapped by mistake \cr
    \code{\link{get_overlapped}} \tab find a list of individuals with overlapped coordinations \cr
    \code{\link{uniqueness}} \tab generate a population without overlapped individuals \cr
    \code{\link{get_treat_names}} \tab get names of measured traits \cr
    \code{\link{remove_traits}} \tab remove traits from community or poulation object \cr
  }
  
 
  \bold{Environment}
  \tabular{ll}{
    \code{\link{env}} \tab define a environment object \cr
    \code{\link{as.environment}} \tab covert other types of object into a environment object \cr
    \code{\link{env_scale}} \tab change scales of the environmental values \cr
    \code{\link{autokriging}} \tab interpolate the environment into different spatial scales \cr
    \code{\link{topo_variables}} \tab calculate various topographic variables based on elevation \cr
    \code{\link{plot.env}} \tab display the map of environment in 2D \cr
  }
 
  
  
  \bold{example data}
  \tabular{ll}{
    \code{\link{BCI}} \tab a small sample of the first 50-ha individual mapped tropical forest plot \cr
  }
}

\section{III. Sampling}{

  \tabular{ll}{
    \code{\link{quadratize}} \tab divide the whole community into several equal size non-overlap grid quadrats \cr
    \code{\link{rquadrat}} \tab random samples of small communities by randomly throwing quadrat \cr
    \code{\link{rdistance}} \tab random samples of neighborhood distances start a random 
                            location/tree to its neighbor \cr
    \code{\link{rpopulation}} \tab generate a randomly distributed population with fixed number of individuals \cr
    \code{\link{rcommunity}} \tab generate a ranodmly distributed community with given species abundance distribution \cr
    \code{\link{frnn}} \tab Find all of the individals in the annulus of given focal individuals  \cr

  }
  
}

\section{III. spatial inexplicit patterns}{
  
  \bold{common indexes for population/community}
  \tabular{ll}{
    \code{\link{area}} \tab total area of the population/community \cr
    \code{\link{plotdim}} \tab the plotdim of the population/community \cr
    \code{\link{total_abundance}} \tab total abundance of the population/community \cr
    \code{\link{total_richness}} \tab total richness of the community \cr
    \code{\link{species_list}} \tab a vector of species in the community \cr
    \code{\link{species_abundance}} \tab species abundance list of the community \cr
    \code{\link{species_frequency}} \tab species frequency list of the community for a given grid\cr
    \code{\link{hill_number}} \tab the equivalent number of equally abundant species\cr
    \code{\link{species_evenness}} \tab species evenness of the community \cr
    \code{\link{important_value}} \tab species' important values in a given community \cr
    \code{\link{species_diversity}} \tab various species diversity indexes \cr
    \code{\link{functional_diversity}} \tab various functiona diversity indexes \cr
    \code{\link{phylogenetic_diversity}} \tab various phylogenetic diversity indexes \cr
    \code{\link{wITV}} \tab relative importance of intraspecific trait variance within community \cr
  }
  
  \bold{common structure of population/community}
  \tabular{ll}{
    \code{\link{size_structure}} \tab BDH size structure of a population or a community \cr
  }
  
  \bold{common indexes for environments}
  \tabular{ll}{
      \code{\link{mean_elevation}} \tab calculate mean elevation for each grid of the topology \cr
    \code{\link{mean_slope}} \tab calculate mean slope for each grid of the topology \cr
    \code{\link{mean_convexity}} \tab calculate mean convexity for each grid of the topology \cr
    \code{\link{mean_aspect}} \tab calculate mean aspect for each grid of the topology \cr
    \code{\link{env_complexity}} \tab calculate complexity of the environment \cr
    \code{\link{fractal_complexity}} \tab calculate the fractal complexity of the topology \cr
  }
  
  \bold{Niche related patterns}
  \tabular{ll}{
    \code{\link{trait_niche}} \tab calculate species trait-based niche \cr
    \code{\link{resouce_niche}} \tab caluclate resource-based niche \cr
    \code{\link{niche_Overlap}} \tab niche overlap matrix between species \cr
  }

}


\section{IV. spatial explicit patterns}{

\bold{basic spatial operation}
\tabular{ll}{
  \code{\link{dist_to_border}} minimum spatial distance of individuals to plot border \cr
}

\bold{Population structures}
\tabular{ll}{
  \code{\link{spatial_abund_distr}} \tab intra-specific spatial abundance distribution \cr
  \code{\link{range_area}} \tab range area relationship by box-counting method \cr
  \code{\link{commonality.population}} \tab intra-specific commonality \cr
  \code{\link{dispersal_distr}} \tab intra-specific dispersal distribution \cr
  \code{\link{dispersion}} \tab spatial dispersion measures by O-ring, K-function, 
              pair correlation function, L function, G function and F function \cr
  \code{\link{ISAR}} \tab individual species area relationship \cr
  \code{\link{nicheKS}} \tab K-S method of niche breath and niche overlap estimation \cr
}

\bold{Community structures}
\tabular{ll}{
  \code{\link{SAD}} \tab species abundance distribution (SAD) \cr
  \code{\link{SAR}} \tab species area relationship (SAR) \cr
  \code{\link{collector_curve}} \tab collector's curve \cr
  \code{\link{EAR}} \tab endemics area relationship (EAR) \cr
  \code{\link{community.community}} \tab community-level commonality \cr
  \code{\link{pairwise_association}} \tab pairwise association measures \cr
  \code{\link{MC}} \tab mark correlation function used in quantify phylogenetic/functional community structure \cr
  \code{\link{MC_change}} \tab mark correlation change function used to quantify the dynamic of phylogenetic/functional structure \cr
}

}

\section{V. null models}{
  
  \bold{Pure random null models}
  \tabular{ll}{
    \code{\link{random_death}} \tab death probability is equals to all of the individuals in the plot \cr
    \code{\link{random_birth}} \tab birth rates of every individuals in the plot are equal \cr
    \code{\link{random_dispersal}} \tab every position in the plot has the same probability be 
                              ocupied by an new individuals \cr
    \code{\link{rtorus}} \tab torus-translation of a given population or all populations in a community \cr
  }
}


\section{VI. Interface with other packages or softwares}{

\bold{The spatstat package}
\tabular{ll}{
  \code{\link{pop_to_ppp}} \tab convert a population object to a ppp object \cr
  \code{\link{ppp_to_pop}} \tab convert a ppp object to a population object \cr
  \code{\link{com_to_ppp}} \tab convert a community object to a marked ppp object \cr
  \code{\link{ppp_to_com}} \tab convert a marked ppp object to a community object \cr
}

  \bold{Interface with the point pattern reconstruction programe writen by Prof. Thorsten Wiegand}

  \tabular{ll}{
   \code{\link{ppreconstruction}} \tab poin pattern reconstruction for a population \cr
  }
}

\section{VII. Other help functions}{

\bold{spatial sample}
\tabular{ll}{
  \code{\link{define_rectSmooth}} \tab define a rectangle kernel smooth object \cr
  \code{\link{apply_rectSmooth}} \tab apply a defined rectangle kernel smooth on a given distance vector \cr
  \code{\link{conf}} \tab calcualte the confidence interval \cr
  \code{\link{lmGofTest}} \tab Loosmore goodness of fit test \cr
  \code{\link{MAD}} \tab Maximum Absolute difference test \cr
  \code{\link{leaf_area}} \tab estimate the percentage of green duckweed within a red circle \cr
  \code{\link{boxCoxTrans}} \tab boxcox transformation of variable \cr
  \code{\link{write_community_file}} \tab write community data file for Programita \cr
  \code{\link{write_dissimilarity_file}} \tab write species interaction data file for Programita \cr
  \code{\link{sendmail}} \tab send an email to a given address \cr
  }

}



\author{
Guochun Shen, Changjiang Gou

Maintainer: Guochun Shen <gcshen@des.ecnu.edu.cn>
}
\references{
~~ Literature or other references for background information ~~
}
\keyword{ package }
\seealso{
~~ Optional links to other man pages, e.g. ~~
~~ \code{\link[<pkg>:<pkg>-package]{<pkg>}} ~~
}
\examples{
%% ~~ simple examples of the most important functions ~~
}
